home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19971216-19980424 / 000036_news@newsmaster….columbia.edu _Fri Jan 2 15:59:13 1998.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA07357
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Fri, 2 Jan 1998 15:59:13 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id PAA03560
  7.     for kermit.misc@watsun; Fri, 2 Jan 1998 15:59:12 -0500 (EST)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Help with scripting kermit
  12. Date: 2 Jan 1998 20:59:10 GMT
  13. Organization: Columbia University
  14. Lines: 71
  15. Message-ID: <68jkeu$q6b$1@apakabar.cc.columbia.edu>
  16. References: <64j0bn$7s9$1@clem.mscd.edu> <0$k2Rz1fk$EP@cc.usu.edu>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Keywords: Echoplex
  19. Xref: news.columbia.edu comp.protocols.kermit.misc:8202
  20.  
  21. On November 20th, Clarence Dold (dold@94.usenet.us.com) wrote:
  22. : Joe Doupnik (jrd@cc.usu.edu) wrote:
  23. : : > output logout\13
  24. : :
  25. : : What's likely the problem is the sequence of OUTPUT statments
  26. : : blasts their strings at the host with no time delay. It may very well
  27. : I have a problem with a long script session going to a telephone switch...
  28. : I am reprogramming information to accomodate area code splits, which is
  29. : just such a wonderful use of Unix awk, c-kermit development, and MS-Kermit
  30. : or C-Kermit execution (but I digress...)
  31. : I use input statements, I use pause statements, and I had to set output
  32. : pacing 500, in order to keep from overrunning the switch, even at 2400
  33. : baud.  There is no flow control available on the line.
  34. : My .tak script (actually 14,000 lines long in this case)
  35. : set output pacing 500
  36. : output 1370444 \13
  37. : input 20 CHANGE
  38. : pause 2
  39. : output \9\9\9\9\9\9 182 \13
  40. : input 20 ACP
  41. : pause 2
  42. : output 1370430 \13
  43. : input 20 CHANGE
  44. : If I lower either the output pacing, or reduce the pause to 1, the switch
  45. : can't keep up.  If I reduce the pause, even with the INPUT in place, the
  46. : commands get garbled.  If I reduce the output pacing, occasional characters
  47. : get dropped.
  48. : I can't remember where I found the description for "output pacing".  I
  49. : can't find it in the Using C-Kermit manual.
  50. : In Unix, the cu dialer has a feature called "echo check", where each
  51. : character is held until the previous character has been echoed back
  52. : correctly.  Is such a pacing option available in C-Kermit?
  53. As noted in my earlier reply, no.  I finally got around to looking into
  54. adding it, and it's not as easy as it might seem, given the facts that the
  55. OUTPUT command is (a) buffered for efficiency, and thus does block writes
  56. rather than single-character ones; (b) might contain \N, \B, or \L escapes
  57. for NUL or BREAK, which might or might not be echoed; (c) in Kermit 95 also
  58. allows \Kverbs; etc etc.
  59.  
  60. It turns out to be much easier to do this with a little macro than in the
  61. C-Kermit code (C-Kermit 6.0 required):
  62.  
  63.   define XOUTPUT {
  64.       local \%c
  65.       set output pacing 0
  66.       while defined \%1 {
  67.       asg \%c \fsubstr(\%1,1,1)
  68.       asg \%1 \fsubstr(\%1,2)
  69.       output \%c
  70.       input 2 \%c
  71.       }
  72.   }
  73.  
  74. Usage: xoutput string-with-no-spaces
  75.    or: xoutput { string that contains spaces }
  76.  
  77. It sends one character at a time and then waits up to 2 seconds for the
  78. character to be echoed back, but continues to the next character as soon
  79. as the echo appears, so no time is wasted.  You can add an IF FAIL clause
  80. after the INPUT in case you want to do something special about failure
  81. to detect an echo within the timeout period.  Obviously you can also change
  82. the 2-second limit, and adjust the script in any other desired way.
  83.  
  84. - Frank